(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
zero(0) → true
zero(s(x)) → false
id(0) → 0
id(s(x)) → s(id(x))
minus(x, 0) → x
minus(s(x), s(y)) → minus(x, y)
mod(x, y) → if_mod(zero(x), zero(y), le(y, x), id(x), id(y))
if_mod(true, b1, b2, x, y) → 0
if_mod(false, b1, b2, x, y) → if2(b1, b2, x, y)
if2(true, b2, x, y) → 0
if2(false, b2, x, y) → if3(b2, x, y)
if3(true, x, y) → mod(minus(x, y), s(y))
if3(false, x, y) → x

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

le(0, y) → true [1]
le(s(x), 0) → false [1]
le(s(x), s(y)) → le(x, y) [1]
zero(0) → true [1]
zero(s(x)) → false [1]
id(0) → 0 [1]
id(s(x)) → s(id(x)) [1]
minus(x, 0) → x [1]
minus(s(x), s(y)) → minus(x, y) [1]
mod(x, y) → if_mod(zero(x), zero(y), le(y, x), id(x), id(y)) [1]
if_mod(true, b1, b2, x, y) → 0 [1]
if_mod(false, b1, b2, x, y) → if2(b1, b2, x, y) [1]
if2(true, b2, x, y) → 0 [1]
if2(false, b2, x, y) → if3(b2, x, y) [1]
if3(true, x, y) → mod(minus(x, y), s(y)) [1]
if3(false, x, y) → x [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

le(0, y) → true [1]
le(s(x), 0) → false [1]
le(s(x), s(y)) → le(x, y) [1]
zero(0) → true [1]
zero(s(x)) → false [1]
id(0) → 0 [1]
id(s(x)) → s(id(x)) [1]
minus(x, 0) → x [1]
minus(s(x), s(y)) → minus(x, y) [1]
mod(x, y) → if_mod(zero(x), zero(y), le(y, x), id(x), id(y)) [1]
if_mod(true, b1, b2, x, y) → 0 [1]
if_mod(false, b1, b2, x, y) → if2(b1, b2, x, y) [1]
if2(true, b2, x, y) → 0 [1]
if2(false, b2, x, y) → if3(b2, x, y) [1]
if3(true, x, y) → mod(minus(x, y), s(y)) [1]
if3(false, x, y) → x [1]

The TRS has the following type information:
le :: 0:s → 0:s → true:false
0 :: 0:s
true :: true:false
s :: 0:s → 0:s
false :: true:false
zero :: 0:s → true:false
id :: 0:s → 0:s
minus :: 0:s → 0:s → 0:s
mod :: 0:s → 0:s → 0:s
if_mod :: true:false → true:false → true:false → 0:s → 0:s → 0:s
if2 :: true:false → true:false → 0:s → 0:s → 0:s
if3 :: true:false → 0:s → 0:s → 0:s

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:


mod
if_mod
if2
if3

(c) The following functions are completely defined:

minus
zero
le
id

Due to the following rules being added:

minus(v0, v1) → 0 [0]

And the following fresh constants: none

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

le(0, y) → true [1]
le(s(x), 0) → false [1]
le(s(x), s(y)) → le(x, y) [1]
zero(0) → true [1]
zero(s(x)) → false [1]
id(0) → 0 [1]
id(s(x)) → s(id(x)) [1]
minus(x, 0) → x [1]
minus(s(x), s(y)) → minus(x, y) [1]
mod(x, y) → if_mod(zero(x), zero(y), le(y, x), id(x), id(y)) [1]
if_mod(true, b1, b2, x, y) → 0 [1]
if_mod(false, b1, b2, x, y) → if2(b1, b2, x, y) [1]
if2(true, b2, x, y) → 0 [1]
if2(false, b2, x, y) → if3(b2, x, y) [1]
if3(true, x, y) → mod(minus(x, y), s(y)) [1]
if3(false, x, y) → x [1]
minus(v0, v1) → 0 [0]

The TRS has the following type information:
le :: 0:s → 0:s → true:false
0 :: 0:s
true :: true:false
s :: 0:s → 0:s
false :: true:false
zero :: 0:s → true:false
id :: 0:s → 0:s
minus :: 0:s → 0:s → 0:s
mod :: 0:s → 0:s → 0:s
if_mod :: true:false → true:false → true:false → 0:s → 0:s → 0:s
if2 :: true:false → true:false → 0:s → 0:s → 0:s
if3 :: true:false → 0:s → 0:s → 0:s

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

le(0, y) → true [1]
le(s(x), 0) → false [1]
le(s(x), s(y)) → le(x, y) [1]
zero(0) → true [1]
zero(s(x)) → false [1]
id(0) → 0 [1]
id(s(x)) → s(id(x)) [1]
minus(x, 0) → x [1]
minus(s(x), s(y)) → minus(x, y) [1]
mod(0, 0) → if_mod(true, true, true, 0, 0) [6]
mod(0, s(x'')) → if_mod(true, false, false, 0, s(id(x''))) [6]
mod(s(x'), 0) → if_mod(false, true, true, s(id(x')), 0) [6]
mod(s(x'), s(x1)) → if_mod(false, false, le(x1, x'), s(id(x')), s(id(x1))) [6]
if_mod(true, b1, b2, x, y) → 0 [1]
if_mod(false, b1, b2, x, y) → if2(b1, b2, x, y) [1]
if2(true, b2, x, y) → 0 [1]
if2(false, b2, x, y) → if3(b2, x, y) [1]
if3(true, x, 0) → mod(x, s(0)) [2]
if3(true, s(x2), s(y')) → mod(minus(x2, y'), s(s(y'))) [2]
if3(true, x, y) → mod(0, s(y)) [1]
if3(false, x, y) → x [1]
minus(v0, v1) → 0 [0]

The TRS has the following type information:
le :: 0:s → 0:s → true:false
0 :: 0:s
true :: true:false
s :: 0:s → 0:s
false :: true:false
zero :: 0:s → true:false
id :: 0:s → 0:s
minus :: 0:s → 0:s → 0:s
mod :: 0:s → 0:s → 0:s
if_mod :: true:false → true:false → true:false → 0:s → 0:s → 0:s
if2 :: true:false → true:false → 0:s → 0:s → 0:s
if3 :: true:false → 0:s → 0:s → 0:s

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0
true => 1
false => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 }→ 1 + id(x) :|: x >= 0, z = 1 + x
if2(z, z', z'', z1) -{ 1 }→ if3(b2, x, y) :|: b2 >= 0, z1 = y, x >= 0, y >= 0, z' = b2, z'' = x, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: b2 >= 0, z1 = y, z = 1, x >= 0, y >= 0, z' = b2, z'' = x
if3(z, z', z'') -{ 1 }→ x :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0
if3(z, z', z'') -{ 2 }→ mod(x, 1 + 0) :|: z'' = 0, z' = x, z = 1, x >= 0
if3(z, z', z'') -{ 2 }→ mod(minus(x2, y'), 1 + (1 + y')) :|: z' = 1 + x2, z = 1, y' >= 0, x2 >= 0, z'' = 1 + y'
if3(z, z', z'') -{ 1 }→ mod(0, 1 + y) :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(b1, b2, x, y) :|: b2 >= 0, z2 = y, b1 >= 0, x >= 0, y >= 0, z' = b1, z = 0, z1 = x, z'' = b2
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: b2 >= 0, z2 = y, b1 >= 0, z = 1, x >= 0, y >= 0, z' = b1, z1 = x, z'' = b2
le(z, z') -{ 1 }→ le(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x
le(z, z') -{ 1 }→ 1 :|: y >= 0, z = 0, z' = y
le(z, z') -{ 1 }→ 0 :|: x >= 0, z = 1 + x, z' = 0
minus(z, z') -{ 1 }→ x :|: x >= 0, z = x, z' = 0
minus(z, z') -{ 1 }→ minus(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x
minus(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(1, 0, 0, 0, 1 + id(x'')) :|: z' = 1 + x'', x'' >= 0, z = 0
mod(z, z') -{ 6 }→ if_mod(0, 1, 1, 1 + id(x'), 0) :|: z = 1 + x', x' >= 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(0, 0, le(x1, x'), 1 + id(x'), 1 + id(x1)) :|: z = 1 + x', x1 >= 0, x' >= 0, z' = 1 + x1
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: x >= 0, z = 1 + x

(11) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(12) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 }→ 1 + id(z - 1) :|: z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 2 }→ mod(minus(z' - 1, z'' - 1), 1 + (1 + (z'' - 1))) :|: z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(1, 0, 0, 0, 1 + id(z' - 1)) :|: z' - 1 >= 0, z = 0
mod(z, z') -{ 6 }→ if_mod(0, 1, 1, 1 + id(z - 1), 0) :|: z - 1 >= 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + id(z - 1), 1 + id(z' - 1)) :|: z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

(13) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ id }
{ minus }
{ le }
{ zero }
{ mod, if_mod, if2, if3 }

(14) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 }→ 1 + id(z - 1) :|: z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 2 }→ mod(minus(z' - 1, z'' - 1), 1 + (1 + (z'' - 1))) :|: z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(1, 0, 0, 0, 1 + id(z' - 1)) :|: z' - 1 >= 0, z = 0
mod(z, z') -{ 6 }→ if_mod(0, 1, 1, 1 + id(z - 1), 0) :|: z - 1 >= 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + id(z - 1), 1 + id(z' - 1)) :|: z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {id}, {minus}, {le}, {zero}, {mod,if_mod,if2,if3}

(15) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: id
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(16) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 }→ 1 + id(z - 1) :|: z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 2 }→ mod(minus(z' - 1, z'' - 1), 1 + (1 + (z'' - 1))) :|: z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(1, 0, 0, 0, 1 + id(z' - 1)) :|: z' - 1 >= 0, z = 0
mod(z, z') -{ 6 }→ if_mod(0, 1, 1, 1 + id(z - 1), 0) :|: z - 1 >= 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + id(z - 1), 1 + id(z' - 1)) :|: z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {id}, {minus}, {le}, {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: ?, size: O(n1) [z]

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: id
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z

(18) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 }→ 1 + id(z - 1) :|: z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 2 }→ mod(minus(z' - 1, z'' - 1), 1 + (1 + (z'' - 1))) :|: z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(1, 0, 0, 0, 1 + id(z' - 1)) :|: z' - 1 >= 0, z = 0
mod(z, z') -{ 6 }→ if_mod(0, 1, 1, 1 + id(z - 1), 0) :|: z - 1 >= 0, z' = 0
mod(z, z') -{ 6 }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + id(z - 1), 1 + id(z' - 1)) :|: z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {minus}, {le}, {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]

(19) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(20) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 2 }→ mod(minus(z' - 1, z'' - 1), 1 + (1 + (z'' - 1))) :|: z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + z + z' }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + s1, 1 + s2) :|: s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {minus}, {le}, {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]

(21) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: minus
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(22) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 2 }→ mod(minus(z' - 1, z'' - 1), 1 + (1 + (z'' - 1))) :|: z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + z + z' }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + s1, 1 + s2) :|: s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {minus}, {le}, {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: ?, size: O(n1) [z]

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: minus
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z'

(24) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 2 }→ mod(minus(z' - 1, z'' - 1), 1 + (1 + (z'' - 1))) :|: z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + z + z' }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + s1, 1 + s2) :|: s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {le}, {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]

(25) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(26) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 + z'' }→ mod(s4, 1 + (1 + (z'' - 1))) :|: s4 >= 0, s4 <= 1 * (z' - 1), z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 + z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + z + z' }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + s1, 1 + s2) :|: s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {le}, {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]

(27) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: le
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(28) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 + z'' }→ mod(s4, 1 + (1 + (z'' - 1))) :|: s4 >= 0, s4 <= 1 * (z' - 1), z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 + z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + z + z' }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + s1, 1 + s2) :|: s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {le}, {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
le: runtime: ?, size: O(1) [1]

(29) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: le
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z'

(30) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 + z'' }→ mod(s4, 1 + (1 + (z'' - 1))) :|: s4 >= 0, s4 <= 1 * (z' - 1), z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 + z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + z + z' }→ if_mod(0, 0, le(z' - 1, z - 1), 1 + s1, 1 + s2) :|: s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
le: runtime: O(n1) [1 + z'], size: O(1) [1]

(31) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(32) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 + z'' }→ mod(s4, 1 + (1 + (z'' - 1))) :|: s4 >= 0, s4 <= 1 * (z' - 1), z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 + z' }→ s5 :|: s5 >= 0, s5 <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 + z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + 2·z + z' }→ if_mod(0, 0, s6, 1 + s1, 1 + s2) :|: s6 >= 0, s6 <= 1, s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
le: runtime: O(n1) [1 + z'], size: O(1) [1]

(33) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: zero
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(34) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 + z'' }→ mod(s4, 1 + (1 + (z'' - 1))) :|: s4 >= 0, s4 <= 1 * (z' - 1), z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 + z' }→ s5 :|: s5 >= 0, s5 <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 + z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + 2·z + z' }→ if_mod(0, 0, s6, 1 + s1, 1 + s2) :|: s6 >= 0, s6 <= 1, s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {zero}, {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
le: runtime: O(n1) [1 + z'], size: O(1) [1]
zero: runtime: ?, size: O(1) [1]

(35) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: zero
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(36) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 + z'' }→ mod(s4, 1 + (1 + (z'' - 1))) :|: s4 >= 0, s4 <= 1 * (z' - 1), z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 + z' }→ s5 :|: s5 >= 0, s5 <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 + z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + 2·z + z' }→ if_mod(0, 0, s6, 1 + s1, 1 + s2) :|: s6 >= 0, s6 <= 1, s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
le: runtime: O(n1) [1 + z'], size: O(1) [1]
zero: runtime: O(1) [1], size: O(1) [1]

(37) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(38) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 + z'' }→ mod(s4, 1 + (1 + (z'' - 1))) :|: s4 >= 0, s4 <= 1 * (z' - 1), z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 + z' }→ s5 :|: s5 >= 0, s5 <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 + z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + 2·z + z' }→ if_mod(0, 0, s6, 1 + s1, 1 + s2) :|: s6 >= 0, s6 <= 1, s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
le: runtime: O(n1) [1 + z'], size: O(1) [1]
zero: runtime: O(1) [1], size: O(1) [1]

(39) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: mod
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

Computed SIZE bound using KoAT for: if_mod
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z1

Computed SIZE bound using KoAT for: if2
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z''

Computed SIZE bound using KoAT for: if3
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z'

(40) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 + z'' }→ mod(s4, 1 + (1 + (z'' - 1))) :|: s4 >= 0, s4 <= 1 * (z' - 1), z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 + z' }→ s5 :|: s5 >= 0, s5 <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 + z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + 2·z + z' }→ if_mod(0, 0, s6, 1 + s1, 1 + s2) :|: s6 >= 0, s6 <= 1, s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed: {mod,if_mod,if2,if3}
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
le: runtime: O(n1) [1 + z'], size: O(1) [1]
zero: runtime: O(1) [1], size: O(1) [1]
mod: runtime: ?, size: O(n1) [z]
if_mod: runtime: ?, size: O(n1) [z1]
if2: runtime: ?, size: O(n1) [z'']
if3: runtime: ?, size: O(n1) [z']

(41) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using KoAT for: mod
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 49 + 30·z + 3·z·z' + 5·z2 + 4·z'

Computed RUNTIME bound using PUBS for: if_mod
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 57 + 33·z1 + 3·z1·z2 + 5·z12 + 4·z2

Computed RUNTIME bound using PUBS for: if2
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 56 + 33·z'' + 3·z''·z1 + 5·z''2 + 4·z1

Computed RUNTIME bound using PUBS for: if3
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 55 + 33·z' + 3·z'·z'' + 5·z'2 + 4·z''

(42) Obligation:

Complexity RNTS consisting of the following rules:

id(z) -{ 1 }→ 0 :|: z = 0
id(z) -{ 1 + z }→ 1 + s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0
if2(z, z', z'', z1) -{ 1 }→ if3(z', z'', z1) :|: z' >= 0, z'' >= 0, z1 >= 0, z = 0
if2(z, z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
if3(z, z', z'') -{ 1 }→ z' :|: z' >= 0, z'' >= 0, z = 0
if3(z, z', z'') -{ 2 + z'' }→ mod(s4, 1 + (1 + (z'' - 1))) :|: s4 >= 0, s4 <= 1 * (z' - 1), z = 1, z'' - 1 >= 0, z' - 1 >= 0
if3(z, z', z'') -{ 2 }→ mod(z', 1 + 0) :|: z'' = 0, z = 1, z' >= 0
if3(z, z', z'') -{ 1 }→ mod(0, 1 + z'') :|: z = 1, z' >= 0, z'' >= 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ if2(z', z'', z1, z2) :|: z'' >= 0, z' >= 0, z1 >= 0, z2 >= 0, z = 0
if_mod(z, z', z'', z1, z2) -{ 1 }→ 0 :|: z'' >= 0, z' >= 0, z = 1, z1 >= 0, z2 >= 0
le(z, z') -{ 1 + z' }→ s5 :|: s5 >= 0, s5 <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z' >= 0, z = 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
minus(z, z') -{ 1 + z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
mod(z, z') -{ 6 }→ if_mod(1, 1, 1, 0, 0) :|: z = 0, z' = 0
mod(z, z') -{ 6 + z' }→ if_mod(1, 0, 0, 0, 1 + s') :|: s' >= 0, s' <= 1 * (z' - 1), z' - 1 >= 0, z = 0
mod(z, z') -{ 6 + z }→ if_mod(0, 1, 1, 1 + s'', 0) :|: s'' >= 0, s'' <= 1 * (z - 1), z - 1 >= 0, z' = 0
mod(z, z') -{ 6 + 2·z + z' }→ if_mod(0, 0, s6, 1 + s1, 1 + s2) :|: s6 >= 0, s6 <= 1, s1 >= 0, s1 <= 1 * (z - 1), s2 >= 0, s2 <= 1 * (z' - 1), z' - 1 >= 0, z - 1 >= 0
zero(z) -{ 1 }→ 1 :|: z = 0
zero(z) -{ 1 }→ 0 :|: z - 1 >= 0

Function symbols to be analyzed:
Previous analysis results are:
id: runtime: O(n1) [1 + z], size: O(n1) [z]
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
le: runtime: O(n1) [1 + z'], size: O(1) [1]
zero: runtime: O(1) [1], size: O(1) [1]
mod: runtime: O(n2) [49 + 30·z + 3·z·z' + 5·z2 + 4·z'], size: O(n1) [z]
if_mod: runtime: O(n2) [57 + 33·z1 + 3·z1·z2 + 5·z12 + 4·z2], size: O(n1) [z1]
if2: runtime: O(n2) [56 + 33·z'' + 3·z''·z1 + 5·z''2 + 4·z1], size: O(n1) [z'']
if3: runtime: O(n2) [55 + 33·z' + 3·z'·z'' + 5·z'2 + 4·z''], size: O(n1) [z']

(43) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(44) BOUNDS(1, n^2)